package com.atguigu.msmservice.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

//从配置文件创建值
@Component
public class MsmUtils implements InitializingBean {

    @Value("${aliyun.msm.keyid}")
    private String keyId;

    @Value("${aliyun.msm.keysecret}")
    private String keySecret;

    @Value("${aliyun.msm.smscode.one}")
    private String smscode;//短信模板名称


    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String SMS_CODE;
    public static String SIGN_NAME = "爱敲代码的小游子";

    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESS_KEY_ID = keyId;
        ACCESS_KEY_SECRET = keySecret;
        SMS_CODE = smscode;
    }
}
